<?php 
header("content-type:text/html;charset=utf8");
$id = $_GET['id'];
$redis = new redis();
$redis->connect("127.0.0.1","6379");
$pdo = new PDO("mysql:host=127.0.0.1;dbname=07c","root","root");
$sql = "select * from shop where shop_id='$id'";
$data = $pdo->query($sql)->fetch(PDO::FETCH_ASSOC);
if($redis->get("visit".$id))
{
	$redis->incr("visit".$id);
	$visit = $redis->get("visit".$id);
	
}else
{
	$redis->set("visit".$id,1);
	$visit = 1;
}

// print_r($data);



 ?>
 <!DOCTYPE html>
 <html lang="en">
 <head>
 	<meta charset="UTF-8">
 	<title>Document</title>
 </head>
 <body>
 	<center>
 	这是您第<?php echo $visit ?>次访问
 		<table>
 			<tr>
 				<td>商品：
 				<td><?php echo $data['shop_name']?></td>
 			</tr>
 			<tr>
 				<td>商品详细：</td>
 				<td><?php echo $data['shop_desc']?></td>
 			</tr>
 		</table>
 	</center>
 </body>
 </html>